﻿using System;
using Super_Management_Mayhem.Content.Spritesheet;
using Transformable_Engine_v2.Engine;
using Transformable_Engine_v2.Engine.Animation.ColorAnimation;
using Transformable_Engine_v2.Engine.Animation.Trajectory;
using Transformable_Engine_v2.Engine.GameObjects.Containers;

namespace Super_Management_Mayhem.Screens
{
    public class FadeToBlack : ImageContainer
    {
         public enum Type
         {
             FadeToBlack,
             FadeFromBlack
         }

        public FadeToBlack(Type type, int delay, int duration)
        {
            Sprite = MenuSheet.GetSprite(MenuSheet.Menu.ColorSquare);
            Scale = Game.Options.ScreenSize;

            switch (type)
            {
                case Type.FadeToBlack:
                    Color = Transformable_Engine_v2.Engine.Graphics.Color.Transparent;
                    AddAnimations(new ColorAnimation(new LinearEasing(), Transformable_Engine_v2.Engine.Graphics.Color.Black, duration, false, delay));
                    break;
                case Type.FadeFromBlack:
                    Color = Transformable_Engine_v2.Engine.Graphics.Color.Black;
                    AddAnimations(new ColorAnimation(new LinearEasing(), Transformable_Engine_v2.Engine.Graphics.Color.Transparent, duration, false, delay));
                    Die(duration + delay);
                    break;
            }
        }
    }
}